import request from '@/utils/request'

export default {

  getList(query,current = 1,size = 20){
    return request({
      url :`/article/category/search`,
      method: 'post',
      data:{
        ...query,
        current,
        size
      }
    })
  },
  add(data) {
   return request({
   url: `/article/category`,
   method: 'post',
   data
   })
   },
   // 查询
    getById(id) {
    return request({
    url: `/article/category/${id}`, // 反单引号 ``
    method: 'get'
    })
    },
    // 更新
    update(data) {
    return request({
    url: `/article/category`,
    method: 'put', // put 方式提交
    data,
    })
    },
    deleteById(id) {
     return request({
     url: `/article/category/${id}`, // 反单引号 ``
     method: 'delete', // delete 方式提交
     })
     },
      //获取所有正常状态的分类
      getNormalList() {
      return request({
      url: `/article/category/list`,
      method: 'get'
      })
      },
      //获取所有正常状态的分类和标签
       getCategoryAndLabel() {
       return request({
       url: `/article/category/label/list`,
       method: 'get'
       })
       }

}
